package com.jctrip.hotel.source.client;

import com.jctrip.hotel.source.model.greentree.req.GetHotelInfoByCodeReq;
import com.jctrip.hotel.source.model.greentree.resp.GetHotelInfoByCodeResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author：Haruhi
 * @description: 酒店信息
 * @Date：2023/8/30 15:56
 * @Package：com.jctrip.hotel.source.client
 * @Project：hotel-main
 */
@FeignClient(name = "GreenTreeHotelClient" ,url = "${feign.url.greentreehotel}")
@RequestMapping(headers = {"accept=application/xml", "Content-Type=application/xml;charset=UTF-8", "Accept-Encoding=gzip, deflate"})
public interface GreenTreeHotelClient {

    /**
     * 获取所有酒店编号及名称
     */
    @PostMapping(value = "HotelInfo/GetAllHotelInfo",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String getAllHotelInfo(@RequestBody MultiValueMap<String, ?> postData);


    /**
     * 获取酒店信息
     */
    @PostMapping(value = "HotelInfo/GetHotelInfo",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String getHotelInfo(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 根据酒店编号获取酒店详细信息(包括品牌)
     * https://console-docs.apipost.cn/preview/6121c5a7b3c28ed1/0c3dec3a1c208f13
     * 密码：362514
     */
    @PostMapping(value = "/HotelInfo/GetHotelInfoByCode",headers = {"accept=application/json", "Content-Type=application/json;charset=UTF-8", "Accept-Encoding=gzip, deflate"})
    GetHotelInfoByCodeResp getHotelInfoByCode(@RequestBody GetHotelInfoByCodeReq param);

    /**
     * 获取酒店所有房型（房型列表）
     */
    @PostMapping(value = "RoomType/GetRoomTypeList",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String getRoomTypeList(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 获取酒店所有房型的房价和房量（正价全量数据）
     */
    @PostMapping(value = "RoomAvailability/GetAllRoomCountAndPrice",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String getAllRoomCountAndPrice(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 获取酒店所有房型的房价和房量（协议全量数据）
     */
    @PostMapping(value = "Agreement/GetAgreementPrice",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String getAgreementPrice(@RequestBody MultiValueMap<String, ?> postData);
}
